package com.wx.chapter11.homework.homework08;

/**
 * @Author : 佩萁
 * Description :
 * @Create : 2023/6/15 - 11:22
 */
enum Color implements ColorInterface {//枚举类，实现接口
    RED(255, 0, 0), BLUE(0, 0, 255), BLACK(0, 0, 0),
    YELLOW(255, 255, 0), GREEN(0, 255, 0);
    //颜色的三个属性
    private int redValue;
    private int greenValue;
    private int blueValue;

    Color(int redValue, int greenValue, int blueValue) {
        this.redValue = redValue;
        this.greenValue = greenValue;
        this.blueValue = blueValue;
    }

    @Override
    public void show() {
        System.out.print("属性值为:");
        System.out.print("redValue:" + redValue);
        System.out.print(" greenValue:" + greenValue);
        System.out.print(" blueValue:" + blueValue);
    }
}

interface ColorInterface {//接口

    void show();
}